package ahut2020.day16final;

public class Factorial {
    static int factorial(int n) {//每次都重复计算
        if (n <= 1) return 1;
        return factorial(n - 1) * n;
    }

    public static void main(String[] args) {
        System.out.println(factorial(5));
        System.out.println(factorial(5));
        for (int i = 0; i <= 12; i++) {
            System.out.println(factorial(i));
        }
    }
}
